To learn about common unit testing strategies in Android, read What to test. By default, the source files for local unit tests are placed in module-name/src/test/. This directory already exists when you create a new project using Android Studio.
要開甚麼專案都行,Android TV , Android Wear 也沒關係,本節重點是放在測試程式. 2. 建立 MyMath 類別並實做加法. public int add(int first, int second) return first + second; 3. 建立測試類別. 請見下圖,Android Studio 專案的測試程式預設是放在 src/androidTest/java/ (packageName) 底下,在這裡建立一個"MyMathTest"的類別. 4.
In this article, we are using JUnit to test our code. JUnit is a “ Unit Testing ” framework for Java Applications which is already included by default in android studio. It is an automation framework for Unit as well as UI Testing. It contains